package learn.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import learn.model.vo.UserVO;
import learn.pojo.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @version 1.0
 * @author: YU.TAN
 * @date: 2023/7/16 16:12
 * @Description:
 */
@RestController
@RequestMapping("/users")
@Api(tags = "用户 API 接口")
public class UserController {

    @GetMapping("/list")
    @ApiOperation(value = "查询用户列表", notes = "目前仅仅是作为测试，所以返回用户全列表")
    public CommonResult<List<UserVO>> list() {
        // 查询列表
        List<UserVO> result = new ArrayList<>();
        result.add(new UserVO("yudaoyuanma",1));
        result.add(new UserVO("woshiyutou",2));
        result.add(new UserVO("chifanshuijiao",4));
        // 返回列表
        return CommonResult.success(result);
    }
}
